package com.fxd.shopping.es.controller;

import com.fxd.common.param.SkuUpEsParam;
import com.fxd.core.util.R;
import com.fxd.shopping.es.service.ProductSaveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/search/save")
public class ElasticSaveController {

    @Autowired
    ProductSaveService productSaveService;

    /**
     * 上架商品
     *
     * @return
     */
    @PostMapping("/product")
    public R<Boolean> productStatusUp(@RequestBody List<SkuUpEsParam> skuUpEsParams) {
        return R.ok(productSaveService.productStatusUp(skuUpEsParams));
    }
}
